<template>
	<view>
		<uni-nav-bar shadow :fixed="true" left-icon="left" title="支付成功"  status-bar @clickLeft="back" :border="false"/>
		<view class="paysuc">
			<img src="../../static/success.png" alt="" style="width: 150rpx; height: 150rpx;"/>
			<view class="" style="font-size: 40rpx; margin-top: 20rpx;">
				下单成功
			</view>
			<view class="">
				预计<text style="color: #3C9CFF;">{{time}}</text>送达
			</view>
			<view class="">
				外卖小哥在努力配送中,请耐心等待~
			</view>
			<view class="bt" >
				<button style="font-size: 30rpx;" @click="gotoPage('home')">返回首页</button>
				<button style="background-color: #3C9CFF; color: #fff; font-size: 30rpx;" @click="gotoPage('orderInfo')">查看订单</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				time:'23:15',
				orderNumber:''
			}
		},
		onLoad(option){
			this.orderNumber = option.orderNumber
		},
		onReady(){
			let times = this.$store.state.estimatedDeliveryTime.split(' ')[1].split(':')
			this.time = times[0] + ':' + times[1]
		},
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				})
			},
			gotoPage(page){
				if(page = 'orderInfo')
					uni.navigateTo({
						url:'/pages/orderInfo/orderInfo?orderNumber=' + this.orderNumber
					})
				else{
					uni.navigateTo({
						url:'/pages/'+page+'/'+page
					})
				}
			}
		}
	}
</script>

<style>
.paysuc{
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	height: 500rpx;
	line-height: 75rpx;
	/* width: 80%; */
	margin-top: 250rpx;
}

.bt{
	display: flex;
	justify-content: space-evenly;
	width: 65%;
	margin-top: 28rpx;
	font-size: 26rpx;
}
</style>
